package com.gome.util;

import etm.core.configuration.BasicEtmConfigurator;
import etm.core.configuration.EtmManager;
import etm.core.monitor.EtmMonitor;
import etm.core.monitor.EtmPoint;
import etm.core.renderer.SimpleTextRenderer;
import etm.core.timer.DefaultTimer;

public class JetmInfo {

	private static EtmMonitor monitor;
	private static EtmPoint point = null;
	public static boolean FLAG=false;
	
	
//	static {
//		
//		if(FLAG){
//		BasicEtmConfigurator.configure();
//		//BasicEtmConfigurator.configure(true);
//		//BasicEtmConfigurator.configure(true, new DefaultTimer());
//		monitor = EtmManager.getEtmMonitor();
//		monitor.start();
//		}
//	}
//	
	public static void ini(){
		if(FLAG){
		BasicEtmConfigurator.configure();
		//BasicEtmConfigurator.configure(true);
		//BasicEtmConfigurator.configure(true, new DefaultTimer());
		monitor = EtmManager.getEtmMonitor();
		monitor.start();
		}
		 
	}

	public  static void JETMStart(String str) {
		ini();
		if(monitor!=null){
			point = monitor.createPoint(str);
		}
	}
	
	
	

	public  static void JETMCollect() {
		if(point!=null){
		point.collect();
		}
	}
	
	
	
	
	
	public  static void JETMEnd() {
		if(monitor!=null){
		monitor.render(new SimpleTextRenderer());
		monitor.stop();
		}
	}
}
